﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Threading;
using System.Security.Cryptography.X509Certificates;

namespace _06_01NortifyPropertyChanged通知更新
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		RedefineProperty redefineProperty = new RedefineProperty() { Name = "000", Age = 1 };

		public MainWindow()
		{
			InitializeComponent();
			DataContext = redefineProperty;
		}

		private void button1_Click(object sender, RoutedEventArgs e)
		{
			Task.Run(() =>
			{
				for (int i = 0; i < 1000; i++)
				{
					redefineProperty.Name = "张三" + i;
					redefineProperty.Age = i;
					Thread.Sleep(100);
				}
			});
		}
	}
}
